package com.abaaba.project2.util;

import javax.xml.crypto.Data;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringToDate {
    public static Date getDate(String s) throws ParseException {
        //指定日期格式
        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = formatter.parse(s);
        return  date;
    }
}
